#ifndef EXCHANGE_INTEROP_DOCUMENT_REFERENCE_H
#define EXCHANGE_INTEROP_DOCUMENT_REFERENCE_H

// #pragma once

#include <sstream>
#include <unordered_map>
#include <vector>
#include "topology/TopoCompound.hpp"

namespace AMCAX::Exchange
{
    namespace InterOp
    {
        class InterOpDocumentInstance;

        /// @brief
        class InterOpDocumentReference
        {
        public:
            InterOpDocumentReference() = default;

            std::vector<std::shared_ptr<InterOpDocumentInstance>> GetDirectChildInstances() const;
            void AddChildInstance(std::shared_ptr<InterOpDocumentInstance> childInstance);
            void RemoveChildInstance(std::shared_ptr<InterOpDocumentInstance> childInstance);

            bool IsPart() const;

            std::string GetName() const;
            void SetName(const std::string &name);
            unsigned int GetId() const;
            void SetId(unsigned int id);

            /// @brief This only works when the reference is a part.
            /// @return
            bool GetPartShape(AMCAX::TopoCompound &topoCompound) const;

            bool SetPartShape(const AMCAX::TopoCompound &topoCompound);

            /// TODO: Not impl.
            bool GetPMIData() const;

        private:
            /// The name of the document
            std::string name_;
            /// The unique id of the document
            unsigned int id_;
            /// The document instance of the reference
            std::vector<std::shared_ptr<InterOpDocumentInstance>> childInstances_;
            /// Geometry data
            AMCAX::TopoCompound partTopoCompound_;
        };
    }
}

#endif // EXCHANGE_INTEROP_DOCUMENT_REFERENCE_H